package com.example.music.manage;

import com.baomidou.mybatisplus.plugins.Page;
import com.example.music.dto.PageInfoBT;
import com.example.music.entity.User;
import com.example.music.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by yinhuachang on 2018/4/23
 *
 */
@Component
public class UserManage {

    @Autowired
    private UserService userService;

    /**
     *
     * @param userName
     * @return
     */
    public PageInfoBT<User> getUserList(String userName,Page page){
        return userService.getUserList(userName,page);
    }

    public User queryUserInfo(String id){
        User user = userService.selectById(id);
        return user;
    }

    public boolean updateEdit(User user,String flag){
            return userService.insertOrUpdate(user);
    }

    public boolean deleteEdit(Long id){
            return userService.deleteById(id);
    }
}
